Method and apparatus for entropy-encoding and entropy-decoding video signal

ABSTRACT

The present invention relates to a method for performing entropy decoding on a video signal including a current block. The method comprises the steps of: deriving affine coding information and/or affine prediction mode information of a left block and/or an upper block which are adjacent to the current block; determining a context index of a syntax element associated with an affine prediction of the current block on the basis of at least one of the affine coding information and/or the affine prediction mode information of the left block and/or the upper block; and entropy decoding the syntax element associated with the affine prediction of the current block on the basis of the context index.

TECHNICAL FIELD

The present disclosure relates to a method and apparatus forentropy-encoding and decoding a video signal and, more particularly, toa method and apparatus for designing a context-based adaptive binaryarithmetic coding (CABAC) context model of syntax elements for an affineprediction.

BACKGROUND ART

Entropy coding is a process of generating a raw byte sequence payload(RBSP) by lossless-compressing syntax elements determined through anencoding process. In entropy coding, syntax elements are represented asbrief data by assigning a short bit to a frequently occurring syntax anda long bit to a not-frequently occurring syntax using the statistics ofsyntaxes.

Among them, context-based adaptive binary arithmetic coding (CABAC) usesa probability model adaptively updated based on the context of syntaxesand a previously generated symbol during a process of performing binaryarithmetic coding. However, such CABAC has problems in that complexityis high because it has a heavy computational load and parallel executionis difficult because CABAC has a sequential structure.

Accordingly, in the video compression technique, it is necessary tocompress and transmit a syntax element more efficiently. To this end, itis necessary to improve performance of entropy coding.

DISCLOSURE Technical Problem

The disclosure is to propose a method for improving predictionperformance of a context model when CABAC is performed.

The disclosure is to propose a method of performing context modeling ona syntax element (affine_flag, affine_param_flag, affine_mvp_idx,mvp_idx, etc.) related to an affine prediction.

The disclosure is to propose a method for improving throughput whilemaintaining coding performance based on context-based adaptive binaryarithmetic coding (CABAC) bypass coding.

Technical Solution

The disclosure proposes a method of performing context modeling on asyntax element (affine_flag, affine_param_flag, affine_mvp_idx, mvp_idx,etc.) related to an affine prediction.

The disclosure a method of determining the context index of a syntaxelement related to an affine prediction based on whether a neighborblock has been affine-coded.

The disclosure proposes a method of determining the context index of asyntax element related to an affine prediction based on at least one ofwhether a neighbor block has been affine-coded (condition 1) and/orwhich affine prediction mode has been applied (condition 2).

The disclosure proposes a method of and separately performing contextmodeling on a motion vector prediction index (affine_mvp_idx) for anaffine prediction and a motion vector prediction index (mvp_idx) for anon-affine prediction.

The disclosure proposes a method of performing context-based adaptivebinary arithmetic coding (CABAC) bypass coding on a syntax elementrelated to an affine prediction.

Advantageous Effects

The disclosure can improve performance of entropy coding/decoding byproviding the method of performing context modeling on a syntax elementrelated to an affine prediction when CABAC is performed.

Furthermore, the disclosure can determine a context model more suitablefor a current block by determining the context index of a syntax elementrelated to an affine prediction based on at least one of whether aneighbor block has been affine-coded (condition 1) and/or which affineprediction mode has been applied (condition 2), and can thus improveperformance of entropy coding/decoding.

Furthermore, the disclosure can improve throughput while maintainingcoding performance by performing context-based adaptive binaryarithmetic coding (CABAC) bypass coding on a syntax element related toan affine prediction.

DESCRIPTION OF DRAWINGS

FIG. 1 is an embodiment to which the disclosure is applied, andillustrates a schematic diagram of an encoder in which the encoding of avideo signal is performed.

FIG. 2 is an embodiment to which the disclosure is applied, andillustrates a schematic block diagram of a decoder in which the decodingof a video signal is performed.

FIG. 3 illustrates a schematic block diagram of an entropy-encoding unitto which context-based adaptive binary arithmetic coding (CABAC) isapplied, as an embodiment to which the disclosure is applied.

FIG. 4 illustrates a schematic block diagram of an entropy-decoding unitto which context-based adaptive binary arithmetic coding (CABAC) isapplied, as an embodiment to which the disclosure is applied.

FIG. 5 illustrates an encoding flowchart performed according tocontext-based adaptive binary arithmetic coding (CABAC), as anembodiment to which the disclosure is applied.

FIG. 6 is an embodiment to which the disclosure is applied, andillustrates a decoding flowchart performed according to context-basedadaptive binary arithmetic coding (CABAC).

FIG. 7 is an embodiment to which the disclosure is applied, andillustrates a block relation diagram for describing a method ofselecting a context model based on a neighbor block.

FIG. 8 is a flowchart illustrating a method of selecting a context modelusing a left block and a top block, as an embodiment to which thedisclosure is applied.

FIG. 9 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of entropy-decoding an affineprediction-related syntax element of a current block.

FIG. 10 is an embodiment to which the disclosure is applied, and is aschematic block diagram of an apparatus for entropy-decoding the affineprediction-related syntax element of a current block.

FIG. 11 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of entropy-decoding the affineprediction-related syntax element of a current block based on affineprediction coding-related information of a neighbor block.

FIG. 12 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of determining the context index of anaffine flag.

FIG. 13 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of determining the context index of anaffine parameter flag.

FIG. 14 is an embodiment to which the disclosure is applied and is aflowchart for describing a method using one context model in order tocode affine_param_flag.

FIG. 15 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for an affine motion prediction based onan affine flag.

FIG. 16 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for separately decoding a motionpredictor index for an affine prediction and a motion predictor indexfor an inter prediction.

FIG. 17 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively determining an optimum codingmode based on at least one of an AF4 mode or an AF6 mode.

FIG. 18 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for performing decoding based on the AF4mode or the AF6 mode.

FIG. 19 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively determining an optimum codingmode among motion vector prediction modes, including the AF4 mode or theAF6 mode, based on a condition A.

FIG. 20 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively performing decoding based on theAF4 mode or the AF6 mode based on the condition A.

FIG. 21 illustrates a video coding system to which the disclosure isapplied.

FIG. 22 illustrates a content streaming system to which the disclosureis applied.

BEST MODE

The disclosure provides a method of performing entropy decoding on avideo signal including a current block, including checking whether anaffine motion prediction has been performed on a current block; parsingthe affine parameter flag of the current block based on a predefined onecontext model when the affine motion prediction is performed on thecurrent block as a result of the check; and updating the context modelbased on the affine parameter flag. The affine parameter flag is a flagindicating whether the affine motion prediction is performed based on anAF4 mode or an AF6 mode. The AF4 mode indicates that the affine motionprediction is performed by four parameters. The AF6 mode indicates thatthe affine motion prediction is performed by six parameters.

In the disclosure, when the affine motion prediction is performed on thecurrent block, the context index of the current block always has a valueof 0, and corresponds to the predefined one context model.

In the disclosure, the checking is performed based on at least one ofaffine coding information and/or affine prediction mode information of aleft block and/or top block neighboring the current block.

The disclosure provides a method of performing entropy decoding on avideo signal including a current block, including deriving affine codinginformation and/or affine prediction mode information of a left blockand/or top block neighboring the current block; determining the contextindex of an affine prediction-related syntax element of the currentblock based on at least one of the affine coding information and/oraffine prediction mode information of the left block and/or the topblock; and entropy-decoding the affine prediction-related syntax elementof the current block based on the context index. In this case, theaffine coding information is information indicating whether an affinemotion prediction has been performed. The affine prediction modeinformation is information indicating whether an affine motionprediction is performed based on an AF4 mode or an AF6 mode. The AF4mode indicates that an affine motion prediction is performed by fourparameters, and the AF6 mode indicates that an affine motion predictionis performed by six parameters.

In the disclosure, when the affine prediction-related syntax elementincludes an affine flag, the context index of the affine flag isdetermined based on the sum of the affine coding information of the leftblock and the affine coding information of the top block. The affineflag is a flag indicating whether an affine motion prediction has beenperformed.

In the disclosure, when the affine prediction-related syntax elementincludes an affine parameter flag, the context index of the affineparameter flag is determined based on the sum of a first valuedetermined by the affine coding information and affine prediction modeinformation of the left block and a second value determined by theaffine coding information and affine prediction mode information of thetop block. The affine parameter flag is a flag indicating whether anaffine motion prediction is performed based on the AF4 mode or the AF6mode.

In the disclosure, when an affine motion prediction is performed on theleft block based on the affine flag and the left block is coded based onthe AF6 mode based on the affine parameter flag, the first value isdetermined as 1. If not, the first value is determined as 0.

In the disclosure, when an affine motion prediction is performed on thetop block based on the affine flag and the top block is coded based onthe AF6 mode based on the affine parameter flag, the second value isdetermined as 1. If not, the second value is determined as 0.

In the disclosure, when the affine prediction-related syntax elementincludes an affine motion vector predictor index and/or a non-affinemotion vector predictor index, the affine motion vector predictor indexand the non-affine motion vector predictor index are defined bydifferent tables. The affine motion vector predictor index indicates acandidate used for an affine motion prediction, and the non-affinemotion vector predictor index indicates a candidate used for an interprediction.

The disclosure provides an apparatus performing entropy decoding on avideo signal including a current block, including a context modelingunit configured to check whether a left block and top block neighboringthe current block are available, derive affine coding information and/oraffine prediction mode information of the left block and/or the topblock when at least one of the left block and/or the top block isavailable, and determine a context index of an affine prediction-relatedsyntax element of the current block based on at least one of the affinecoding information and/or affine prediction mode information of the leftblock and/or the top block, and a binary arithmetic decoding unitconfigured to entropy-decode an affine prediction-related syntax elementof the current block based on the context index. The affine codinginformation is information indicating whether an affine motionprediction has been performed. The affine prediction mode information isinformation indicating whether the affine motion prediction is performedbased on an AF4 mode or an AF6 mode. The AF4 mode indicates that anaffine motion prediction is performed by four parameters. The AF6 modeindicates that an affine motion prediction is performed by sixparameters.

MODE FOR INVENTION

Hereinafter, exemplary elements and operations in accordance withembodiments of the disclosure are described with reference to theaccompanying drawings. It is however to be noted that the elements andoperations of the disclosure described with reference to the drawingsare provided as only embodiments and the technical spirit and kernelconfiguration and operation of the disclosure are not limited thereto.

In addition, terms used in this specification are common terms that arenow widely used, but in special cases, terms randomly selected by theapplicant are used. In such a case, the meaning of a corresponding termis clearly described in the detailed description of a correspondingpart. Accordingly, it is to be noted that the disclosure should not beconstrued as being based on only the name of a term used in acorresponding description of this specification and that the disclosureshould be construed by checking even the meaning of a correspondingterm.

Furthermore, terms used in the present disclosure are common termsselected to describe the disclosure, but may be replaced with otherterms for more appropriate analysis if such terms having similarmeanings are present. For example, a signal, data, a sample, a picture,a frame, and a block may be properly replaced and interpreted in eachcoding process.

In addition, the concepts and the methods described in the presentdisclosure may be applied to other embodiments, and the combination ofthe embodiments is also applicable within the inventive concept of thedisclosure although it is not explicitly described in the presentdisclosure.

FIG. 1 is an embodiment to which the disclosure is applied, andillustrates a schematic diagram of an encoder in which the encoding of avideo signal is performed.

Referring to FIG. 1, the encoder 100 may be configured to include animage segmentation unit 110, a transform unit 120, a quantization unit130, a de-quantization unit 140, an inverse transform unit 150, afiltering unit 160, a decoded picture buffer (DPB) 170, an interprediction unit 180, an intra prediction unit 185, and an entropyencoding unit 190.

The image segmentation unit 110 may segment an input image (or pictureor frame), input to the encoder 100, into one or more processing units.For example, the processing unit may be a coding tree unit (CTU), acoding unit (CU), a prediction unit (PU) or a transform unit (TU). Inthis case, the segmentation may be performed by at least one method of aquadtree (QT), a binary tree (BT), a ternary tree (TT), or an asymmetrictree (AT).

In video coding, one block may be partitioned based on a quadtree (QT).Furthermore, one sub block partitioned by the QT may be furtherrecursively partitioned using the QT. A leaf block that is no longerQT-partitioned may be partitioned by at least one method of a binarytree (BT), a ternary tree (TT) or an asymmetric tree (AT). The BT mayhave two types of partitions, including a horizontal BT (2N×N, 2N×N) anda vertical BT (N×2N, N×2N). The TT may have two types of partitions,including a horizontal TT (2N×½N, 2N×N, 2N×½N) and a vertical TT (½N×2N,N×2N, ½N×2N). The AT may have four types of partitions, including ahorizontal-up AT (2N×½N, 2N×3/2N), a horizontal-down AT (2N×3/2N,2N×½N), a vertical-left AT (½N×2N, 3/2N×2N), and a vertical-right AT(3/2N×2N, ½N×2N). The BT, TT, and AT may be further recursivelypartitioned using a BT, a TT, and an AT, respectively.

Meanwhile, the BT, TT, and AT may be together used and partitioned. Forexample, a subblock partitioned by a BT may be partitioned by a TT or anAT. Furthermore, a subblock partitioned by a TT may be partitioned by aBT or an AT. A subblock partitioned by an AT may be partitioned by a BTor a TT. For example, after a horizontal BT partition, each subblock maybe partitioned into vertical BTs or after a vertical BT partition, eachsubblock may be partitioned into horizontal BTs. The two types ofpartition methods are different in their sequence, but have the sameshape that is finally partitioned.

Furthermore, the sequence in which a block is searched for after theblock is partitioned may be defined in various ways. In general, searchis performed from the left to the right and from the top to the bottom.To search for a block may mean a sequence for determining whether eachpartitioned subblock will be block-partitioned, may mean the codingsequence of each subblock if a block is no longer partitioned, or maymean a search sequence when reference is made to information of anotherneighbor block in a subblock.

In this case, the terms are merely used for convenience of descriptionof the disclosure, and the disclosure is not limited to the definitionof a corresponding term. Furthermore, in the disclosure, for convenienceof description, a term called a coding unit is used as a unit used in aprocess of encoding or decoding a video signal, but the disclosure isnot limited thereto and the term may be properly interpreted based onthe contents of the disclosure.

The encoder 100 may generate a residual signal by subtracting aprediction signal, output by the inter prediction unit 180 or the intraprediction unit 185, from the input image signal. The generated residualsignal is transmitted to the transform unit 120.

The transform unit 120 may generate a transform coefficient by applyinga transform scheme to the residual signal. The transform process may beapplied to a pixel block having a square having the same size and may beapplied to a block having a variable size, that is, not a square.

The quantization unit 130 may quantize the transform coefficient andtransmit it to the entropy encoding unit 190. The entropy encoding unit190 may entropy-code the quantized signal and output it as a bitstream.

The entropy encoding unit 190 may perform entropy encoding on syntaxelements. This is more specifically described in FIG. 3 and thedisclosure.

For example, an embodiment of the disclosure proposes a method ofperforming context modeling on a syntax element (affine_flag,affine_param_flag, affine_mvp_idx, mvp_idx, etc.) related to an affineprediction.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on whether aneighbor block has been affine-coded.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on at least oneof whether a neighbor block has been affine-coded (condition 1) and/orwhich affine prediction mode has been applied (condition 2).

Another embodiment proposes a method of separately performing contextmodeling on a motion vector prediction index (affine_mvp_idx) for anaffine prediction and a motion vector prediction index (mvp_idx) for anon-affine prediction.

Another embodiment proposes a method of performing context-basedadaptive binary arithmetic coding (CABAC) bypass coding on a syntaxelement related to an affine prediction.

The quantized signal output by the quantization unit 130 may be used togenerate a prediction signal. For example, a residual signal may bereconstructed by applying de-quantization and an inverse transform tothe quantized signal through the de-quantization unit 140 and theinverse transform unit 150 within a loop. A reconstructed signal may begenerated by adding the reconstructed residual signal to the predictionsignal output by the inter prediction unit 180 or the intra predictionunit 185.

Meanwhile, in such a compression process, artifacts in which a blockboundary appears because neighboring blocks are quantized by differentquantization parameters may occur. Such a phenomenon is called ablocking artifact. The block artifact is one of important factors toevaluate picture quality. In order to reduce such artifacts, a filteringprocess may be performed. Picture quality can be improved by removingblocking artifacts and also reducing an error of a current picturethrough such a filtering process.

The filtering unit 160 may apply filtering to the reconstructed signaland output it to a playback device or transmit it to the decoded picturebuffer 170. The filtered signal transmitted to the decoded picturebuffer 170 may be used as a reference picture in the inter predictionunit 180. As described above, both picture quality and coding efficiencycan be improved using the filtered picture as a reference picture in aninter prediction mode.

The decoded picture buffer 170 may store the filtered picture in orderto use it as a reference picture in the inter prediction unit 180.

The inter prediction unit 180 performs a temporal prediction and/or aspatial prediction with reference to a reconstructed picture in order toremove temporal redundancy and/or spatial redundancy. In this case, thereference picture used to perform the prediction may include a blockingartifact or a ringing artifact because it is a signal on whichquantization and de-quantization has been previously performed in ablock unit upon coding/decoding.

Accordingly, in order to solve the discontinuity of such a signal orperformance degradation attributable to quantization, the interprediction unit 180 may interpolate a signal between pixels in asubpixel unit by applying a lowpass filter. In this case, the subpixelmeans a virtual pixel generated by applying an interpolation filter, andan integer pixel means an actual pixel present in a reconstructedpicture. Linear interpolation, bi-linear interpolation or a wienerfilter may be applied as an interpolation method.

The interpolation filter may be applied to the reconstructed picture,thereby being improving the precision of a prediction. For example, theinter prediction unit 180 may generate an interpolation pixel byapplying an interpolation filter to an integer pixel, and may perform aprediction using an interpolated block configured with interpolationpixels as a prediction block.

The inter prediction unit 180 may perform an affine motion vectorprediction based on at least one of an affine flag and/or an affineparameter flag.

In the disclosure, an affine mode (AF mode) means an affine motionprediction mode using an affine motion model, and may include at leastone of an affine merge mode or an affine inter mode, for example. Theaffine inter mode may include at least one of an AF4 mode or an AF6mode.

The affine flag may indicate whether an affine prediction (affine motionprediction or affine motion vector prediction) is performed or mayindicate whether an AF mode is performed. For example, the affine flagmay be represented as affine_flag. The affine flag indicates that an AFmode is applied to a current block when the affine_flag=1, and indicatesthat an AF mode is not applied to the current block when theaffine_flag=0.

When an AF mode is not applied to a current block, the decoder mayperform decoding (i.e., motion vector prediction) based on a coding modenot an AF mode. For example, a skip mode, a merge mode or an inter modemay be used.

The affine parameter flag is a flag indicating whether an affine motionprediction is performed based on the AF4 mode or the AF6 mode. Forexample, the affine parameter flag may be represented asaffine_param_flag. The affine parameter flag may mean that a motionvector prediction is performed based on the AF4 mode when theaffine_param_flag=0, and that a motion vector prediction is performedbased on the AF6 mode when the affine_param_flag=1, but the disclosureis not limited thereto.

For another example, the affine parameter flag may include at least oneof AF4_flag and AF6_flag.

AF4_flag indicates whether the AF4 mode is performed on a current block.The AF4 mode is performed on the current block when AF4_flag=1, and theAF4 mode is not performed on the current block when AF4_flag=0. In thiscase, if the AF4 mode is performed, this means that a motion vectorprediction is performed using an affine motion model represented as fourparameters.

AF6_flag indicates whether the AF6 mode is performed on a current block.The AF6 mode is performed on the current block when AF6_flag=1, and theAF6 mode is not performed on the current block when AF6_flag=0. In thiscase, if the AF6 mode is performed, this means that a motion vectorprediction is performed using an affine motion model represented as sixparameters.

The affine flag and the affine parameter flag may be defined in at leastone level of a slice, a maximum coding unit, a coding unit or aprediction unit. For example, at least one of AF_flag, AF4_flag andAF6_flag may be defined in a slice level, and may be defined in a blocklevel or a prediction unit level.

The intra prediction unit 185 may predict a current block with referenceto surrounding samples of a block on which coding is to be performed.The intra prediction unit 185 may perform the following process in orderto perform an intra prediction. First, a reference sample necessary togenerate a prediction signal may be prepared. Furthermore, a predictionsignal may be generated using the prepared reference sample. Thereafter,a prediction mode is coded. In this case, the reference sample may beprepared through reference sample padding and/or reference samplefiltering. The reference sample may include a quantization error becauseit has been experienced a prediction and reconstruction process.Accordingly, in order to reduce such an error, a reference samplefiltering process may be performed on each prediction mode used for anintra prediction.

The prediction signal generated through the inter prediction unit 180 orthe intra prediction unit 185 may be used to generate a reconstructedsignal or to generate a residual signal.

FIG. 2 is an embodiment to which the disclosure is applied, andillustrates a schematic block diagram of a decoder in which the decodingof a video signal is performed.

Referring to FIG. 2, the decoder 200 may be configured to include aparsing unit (not illustrated), an entropy decoding unit 210, ade-quantization unit 220, an inverse transform unit 230, a filteringunit 240, a decoded picture buffer (DPB) unit 250, an inter predictionunit 260, an intra prediction unit 265 and a reconstruction unit (notillustrated).

The decoder 200 may receive a signal output by the encoder 100 in FIG.1, and may parse or obtain a syntax element through the parsing unit(not illustrated). The parsed or obtained signal may be entropy-decodedthrough the entropy decoding unit 210. This is more specificallydescribed in FIG. 4 and the disclosure.

For example, an embodiment of the disclosure proposes a method ofperforming context modeling on a syntax element (affine_flag,affine_param_flag, affine_mvp_idx, mvp_idx, etc.) related to an affineprediction.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on whether aneighbor block has been affine-coded.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on at least oneof whether a neighbor block has been affine-coded (condition 1) and/orwhich affine prediction mode has been applied (condition 2).

Another embodiment proposes a method of separately performing contextmodeling on a motion vector prediction index (affine_mvp_idx) for anaffine prediction and a motion vector prediction index (mvp_idx) for anon-affine prediction.

Another embodiment proposes a method of performing context-basedadaptive binary arithmetic coding (CABAC) bypass coding on a syntaxelement related to an affine prediction.

The de-quantization unit 220 obtains a transform coefficient from theentropy-decoded signal using quantization step size information.

The inverse transform unit 230 obtains a residual signal byinverse-transforming the transform coefficient.

The reconstruction unit (not illustrated) generates a reconstructedsignal by adding the obtained residual signal to the prediction signaloutput by the inter prediction unit 260 or the intra prediction unit265.

the filtering unit 240 applies filtering to the reconstructed signal andoutputs the filtered signal to a playback device or transmits it to thedecoded picture buffer unit 250. The filtered signal transmitted to thedecoded picture buffer unit 250 may be used as a reference picture inthe inter prediction unit 260.

In the disclosure, the embodiments described in the filtering unit 160,inter prediction unit 180 and intra prediction unit 185 of the encoder100 may be identically applied to the filtering unit 240, interprediction unit 260 and intra prediction unit 265 of the decoder,respectively.

The reconstructed video signal output through the decoder 200 may beplayed back through a playback device.

FIG. 3 illustrates a schematic block diagram of an entropy encoding unitto which context-based adaptive binary arithmetic coding (CABAC) isapplied, as an embodiment to which the disclosure is applied.

An entropy-encoding unit 300 to which the disclosure is applied includesa binarization unit 310, a context modeling unit 320, a binaryarithmetic encoding unit 330 and a memory 360. The binary arithmeticencoding unit 330 includes a regular binary encoding unit 340 and abypass binary encoding unit 350. In this case, the regular binaryencoding unit 340 and the bypass binary encoding unit 350 may be calledas a regular coding engine and a bypass coding engine, respectively.

The binarization unit 310 may receive a sequence of data symbols andperform binarization thereon to output a binary symbol (bin) stringincluding a binarized value of 0 or 1. The binarization unit 310 may mapsyntax elements to binary symbols. Various different binarizationprocesses, e.g., unary (U), truncated unary (TU), k-order Exp-Golomb(EGk), and fixed length processes, and the like, may be used forbinarization. The binarization process may be selected on the basis of atype of a syntax element.

The output binary symbol string is transmitted to the context modelingunit 320.

The context modeling unit 320 selects probability information necessaryto code a current block from the memory, and transmits it to the binaryarithmetic encoding unit 330. For example, the context modeling unit 320may select a context memory based on a syntax element to code, and mayselect probability information necessary to code a current syntaxelement through a bin index (binIdx). In this case, the context meansinformation on the probability that a symbol is generated. The contextmodeling means a process of estimating the probability of a binnecessary for binary arithmetic coding using a bin, that is, a result ofbinarization, as an input.

The context modeling unit 320 may provide accurate probabilityestimation necessary to obtain high coding efficiency. Thus, differentcontext models may be used for different binary symbols, and theprobability of context models may be updated based on values ofpreviously coded binary symbols. In this case, the values of previouslycoded binary symbols may be stored in the memory 360, and the contextmodeling unit 320 may use the values of previously coded binary symbolsfrom it.

Binary symbols having a similar distribution may share the same contextmodel. A context model related to each binary symbol may use at leastone of syntax information of a bin, a bin index indicating the positionof the bin in a bin string and the probability of a bin included in aneighboring block of a block including the bin.

An embodiment of the disclosure proposes a method of performing contextmodeling on a syntax element (affine_flag, affine_param_flag,affine_mvp_idx, mvp_idx, etc.) related to an affine prediction.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on whether aneighbor block has been affine-coded.

According to the disclosure, when a context model is determined, thebinary arithmetic encoding unit 330 may perform binary arithmeticencoding based on the context model.

The binary arithmetic encoding unit 330 includes a regular binaryencoding unit 340 and a bypass binary encoding unit 350, and performsentropy-encoding on the output string and outputs compressed data bits.

The regular binary encoding unit 340 performs an arithmetic coding basedon recursive interval division.

First, an interval (or a range) having an initial value of 0 to 1 isdivided into two subintervals based on the probability of the bin. Theencoded bits provide an offset that, when converted to a binaryfraction, selects one of the two subintervals, which indicates the valueof the decoded bin.

After every decoded bin, the interval may be updated to equal theselected subinterval, and the interval division process repeats itself.The interval and offset have limited bit precision, so renormalizationmay be required whenever the interval falls below a specific value toprevent underflow. The renormalization may occur after each bin isdecoded.

The bypass binary encoding unit 350 performs encoding without a contextmode, and performs coding by fixing probability of a currently coded binto 0.5. This may be used when it is difficult to determine a probabilityof syntax or it is designed to code with high speed.

FIG. 4 illustrates a schematic block diagram of an entropy-decoding unitto which context-based adaptive binary arithmetic coding (CABAC) isapplied, as an embodiment to which the disclosure is applied.

An entropy-decoding unit 400 includes a context modeling unit 410, abinary arithmetic decoding unit 420, a memory 450 and an inversebinarization unit 460. The binary arithmetic decoding unit 420 includesa regular binary decoding unit 430 and a bypass binary decoding unit440.

The entropy-decoding unit 400 may receive a bit stream and identify abypass flag in the bit stream. In this case, the bypass flag indicateswhether a mode is a bypass mode. The bypass mode means that coding isperformed by fixing the probability of a currently coded bin to 0.5without using a context model.

If a mode is not the bypass mode based on the bypass flag, the regularbinary decoding unit 430 performs binary arithmetic decoding accordingto the regular mode.

In this case, the context modeling unit 410 selects probabilityinformation necessary to decode a current bit stream from the memory450, and transmits the probability information to the regular binarydecoding unit 430.

An embodiment of the disclosure proposes a method of performing contextmodeling on a syntax element (affine_flag, affine_param_flag,affine_mvp_idx, mvp_idx, etc.) related to an affine prediction.

Another embodiment proposes a method of determining the context index ofa syntax element related to an affine prediction based on whether aneighbor block has been affine-coded.

According to the disclosure, when the context model is determined, thebinary arithmetic decoding unit 420 may perform binary arithmeticdecoding based on the context model.

Meanwhile, in the case of the bypass mode according to the bypass flag,the bypass binary decoding unit 440 performs a binary arithmeticdecoding according to the bypass mode.

The inverse binarization unit 460 receives bin in a binary number formdecoded from the binary arithmetic decoding unit 420, and transforms andoutputs it into a syntax element value in an integer form.

FIG. 5 illustrates an encoding flowchart performed according tocontext-based adaptive binary arithmetic coding (CABAC), as anembodiment to which the disclosure is applied.

An encoder may perform a binarization for a syntax element (S510).

The encoder may check whether to perform binary arithmetic codingaccording to the regular mode or perform binary arithmetic codingaccording to the bypass mode (S520). For example, the encoder may checkwhether it is in the regular mode or the bypass mode based on a bypassflag, and for example, when the bypass flag is 1, this may indicate thebypass mode, and when the bypass flag is 0, this may indicate theregular mode.

When a mode is the regular mode, the encoder may select a probabilitymodel (S530), and may perform binary arithmetic decoding based on theprobability model (S540). Further, the encoder may update theprobability model (S550), and may select a proper probability modelagain based on the updated probability model updated in step S530.

In an embodiment of the disclosure, context modeling may be performed ona syntax element (affine_flag, affine_param_flag, affine_mvp_idx,mvp_idx, etc.) related to an affine prediction.

In another embodiment, the context index of a syntax element related toan affine prediction may be determined based on whether a neighbor blockhas been affine-coded.

In another embodiment, the context index of a syntax element related toan affine prediction may be determined based on at least one of whethera neighbor block has been affine-coded (condition 1) and/or which affineprediction mode has been applied (condition 2).

In another embodiment, context modeling may be separately performed on amotion vector prediction index (affine_mvp_idx) for an affine predictionand a motion vector prediction index (mvp_idx) for a non-affineprediction.

Meanwhile, when a mode is the bypass mode, the encoder may performbinary arithmetic encoding based on a probability 0.5 (S560).

An embodiment of the disclosure proposes a method of performingcontext-based adaptive binary arithmetic coding (CABAC) bypass coding ona syntax element related to an affine prediction.

FIG. 6 is an embodiment to which the disclosure is applied, andillustrates a decoding flowchart performed according to context-basedadaptive binary arithmetic coding (CABAC).

First, the decoder may receive a bitstream (S610).

The decoder may confirm whether a mode is a regular mode or a bypassmode by extracting a bypass flag from the bitstream (S620). In thiscase, the bypass flag may have been previously determined based on thetype of syntax.

For example, context-based adaptive binary arithmetic coding (CABAC)bypass coding may be performed on a syntax element related to an affineprediction.

When the bypass flag indicates the regular mode, the decoder may selecta probability model (S630), and may perform binary arithmetic decodingbased on the probability model (S640). Furthermore, the decoder mayupdate the probability model (S650), and may select a proper probabilitymodel based on the probability model updated in step S630.

In an embodiment of the disclosure, context modeling may be performed ona syntax element (affine_flag, affine_param_flag, affine_mvp_idx,mvp_idx, etc.) related to an affine prediction.

In another embodiment, the context index of a syntax element related toan affine prediction may be determined based on whether a neighbor blockhas been affine-coded.

In another embodiment, the context index of a syntax element related toan affine prediction may be determined based on at least one of whethera neighbor block has been affine-coded (condition 1) and/or which affineprediction mode has been applied (condition 2).

In another embodiment, context modeling may be separately performed on amotion vector prediction index (affine_mvp_idx) for an affine predictionand a motion vector prediction index (mvp_idx) for a non-affineprediction.

Meanwhile, when the bypass flag indicates the bypass mode, the decodermay perform binary arithmetic decoding based on a probability of 0.5(S660).

The decoder may perform reverse binarization on a decoded bin string(S670). For example, the decoder may receive a bin of a decoded binaryform, may transform the bit into a syntax element value of an integerform, and may output the value.

FIG. 7 is an embodiment to which the disclosure is applied, andillustrates a block relation diagram for describing a method ofselecting a context model based on a neighbor block.

A context model of CABAC may be considered in various ways depending onstatistical characteristics. For example, when one context model isused, it may be used without considering a special condition. However,when three context models are used, a context model may be designedbased on a condition, that is, the syntax element of a neighbor block.

Referring to FIG. 7, it is assumed that a current block is C, a leftblock neighboring the current block is L, and a top block is A. Acontext model for the syntax of the current block C may be determinedusing at least one of the left block L or top block A, that is, aneighbor block. Equation 1 shows a method of selecting a context modelusing a left block and a top block.

CtxIdx=(condL&&availableL)+(condA&&availableA)  [Equation 1]

In this case, availableL and availableA indicate whether a left blockand a top block are present, respectively. condL and condA mean valuesof corresponding syntaxes for the left block and the top block,respectively.

According to Equation 1, three context models may be used based on asyntax value of a neighbor block. The context model may be determinedbased on a syntax value of a neighbor block regardless of the size of acurrent block or the size of a neighbor block. However, the statisticalcharacteristics of an affine prediction-related syntax element may bedifferent depending on information related to the affine predictioncoding of a neighbor block.

Accordingly, the disclosure proposes a method of determining a contextmodel based on information related to the affine prediction coding of aneighbor block.

FIG. 8 is a flowchart illustrating a method of selecting a context modelusing a left block and a top block, as an embodiment to which thedisclosure is applied.

According to the disclosure, the method of selecting a context model maybe applied to both the encoder and the decoder. This is described basedon the decoder, for convenience of description.

First, the decoder may derive a left block and a top block neighboring acurrent block (S810). That is, the decoder may check whether the leftblock and the top block neighboring the current block are available.

When at least one of the left block and the top block is available, thedecoder may derive a syntax value from at least one of the left blockand the top block (S820).

In addition, the decoder may determine a context model based on a syntaxvalue of at least one of the left block and the top block (S830).

The decoder may derive a context index (CtxIdx) value based on thedetermined context model (S840).

The decoder may perform binary arithmetic decoding based on the contextindex (CtxIdx) value (S850).

FIG. 9 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of entropy-decoding an affineprediction-related syntax element of a current block.

The decoder may derive affine coding information and/or affineprediction mode information of a left block and/or top block neighboringa current block (S910).

In this case, the affine coding information is information indicatingwhether an affine motion prediction has been performed. For example, theaffine coding information of the left block may be indicated asaffine_L, and the affine coding information of the top block may beindicated as affine_A.

The affine prediction mode information is information indicating whetheran affine motion prediction is performed based on the AF4 mode or theAF6 mode. The AF4 mode indicates that an affine motion prediction isperformed by four parameters. The AF6 mode indicates that an affinemotion prediction is performed by six parameters. For example, theaffine prediction mode information of the left block may be indicated asaffine_param_L, and the affine prediction mode information of the topblock may be indicated as affine_param_A.

The decoder may determine the context index of an affineprediction-related syntax element of the current block based on at leastone of the affine coding information and/or affine prediction modeinformation of the left block and/or the top block (S920).

The decoder may entropy-decode the affine prediction-related syntaxelement of the current block based on the context index (S930).

The entropy-decoded affine prediction-related syntax element may be usedfor an affine motion vector prediction.

FIG. 10 is an embodiment to which the disclosure is applied, and is aschematic block diagram of an apparatus for entropy-decoding the affineprediction-related syntax element of a current block.

The entropy decoding unit to which the disclosure is applied may includean element 1010 to derive affine coding information and/or affineprediction mode information of a neighbor block, an element 1020 todetermine the context index of an affine prediction-related syntaxelement of a current block, and an element 1030 to entropy-decode theaffine prediction-related syntax element of the current block.

The element 1010 to derive affine coding information and/or affineprediction mode information of a neighbor block may derive affine codinginformation and/or affine prediction mode information of a left blockand/or top block neighboring a current block.

The element 1020 to determine the context index of an affineprediction-related syntax element of a current block may determine thecontext index of an affine prediction-related syntax element of thecurrent block based on at least one of the affine coding informationand/or affine prediction mode information of the top block and/or theleft block.

The element 1030 to entropy-decode the affine prediction-related syntaxelement of the current block may entropy-decode the affineprediction-related syntax element of the current block based on thecontext index.

The entropy-decoded affine prediction-related syntax element may be usedfor an affine motion vector prediction.

FIG. 11 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of entropy-decoding the affineprediction-related syntax element of a current block based on affineprediction coding-related information of a neighbor block.

The decoder may check whether a left block and top block neighboring acurrent block are available (S1110).

If at least one of the left block and/or the top block is available, thedecoder may derive affine coding information and/or affine predictionmode information of the left block and/or the top block (S1120).

In this case, the affine coding information is information indicatingwhether an affine motion prediction has been performed. For example, theaffine coding information of the left block may be indicated asaffine_L, and the affine coding information of the top block may beindicated as affine_A.

The affine prediction mode information is information indicating whetheran affine motion prediction is performed based on the AF4 mode or theAF6 mode. The AF4 mode indicates that an affine motion prediction isperformed by four parameters, and the AF6 mode indicates that an affinemotion prediction is performed by six parameters. For example, theaffine prediction mode information of the left block may be indicated asaffine_param_L, and the affine prediction mode information of the topblock may be indicated as affine_param_A.

The decoder may determine the context index of an affineprediction-related syntax element of the current block based on at leastone of the affine coding information and/or affine prediction modeinformation of the left block and/or the top block (S1130).

In one embodiment, when the affine prediction-related syntax elementincludes an affine flag, the context index of the affine flag may bedetermined based on the sum of the affine coding information of the leftblock and the affine coding information of the top block. In this case,the affine flag indicates whether an affine motion prediction has beenperformed.

In one embodiment, when the affine prediction-related syntax elementincludes an affine parameter flag, the context index of the affineparameter flag may be determined based on the sum of a first valuedetermined by the affine coding information and affine prediction modeinformation of the left block and a second value determined by theaffine coding information and affine prediction mode information of thetop block. In this case, the affine parameter flag indicates whether anaffine motion prediction is performed based on the AF4 mode or the AF6mode.

For example, when an affine motion prediction is performed on the leftblock based on the affine flag and the left block is coded based on theAF6 mode based on the affine parameter flag, the first value isdetermined as 1. If not, the first value is determined as 0.

For example, when an affine motion prediction is performed on the topblock based on the affine flag and the top block is coded based on theAF6 mode based on the affine parameter flag, the second value isdetermined as 1. If not, the second value is determined as 0.

For another example, when the affine prediction-related syntax elementincludes an affine motion vector predictor index and/or a non-affinemotion vector predictor index, the affine motion vector predictor indexand the non-affine motion vector predictor index may be defined bydifferent tables. In this case, the affine motion vector predictor indexindicates a candidate used for an affine motion prediction, and thenon-affine motion vector predictor index indicates a candidate used foran inter prediction.

The decoder may entropy-decode the affine prediction-related syntaxelement of the current block based on the context index (S1140).

The entropy-decoded affine prediction-related syntax element may be usedfor an affine motion vector prediction.

FIG. 12 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of determining the context index of anaffine flag.

An embodiment of the disclosure proposes a context model for an affineflag (affine_flag). The context model of a current block C is configuredwith three context models based on affine coding information of aneighboring left block L and top block A. Acontext index may bedetermined like Equation 2. In this case, the affine coding informationindicates whether an affine motion prediction has been performed.

ctx_idx_for_affine_flag=affine_L+affine_A  [Equation 2]

In this case, ctx_idx_for_affine_flag is a context index for the affineflag (affine_flag), and may have a value of 0-2.

For example, affine_L indicates whether an affine motion prediction hasbeen performed on a left block. affine_A indicates whether an affinemotion prediction has been performed on a top block. When an affinemotion prediction is performed, affine_L or affine_A have a value of 1.When an affine motion prediction is not performed, affine_L or affine_Ahas a value of 0.

As the number of neighbor blocks on which an affine motion predictionhas been performed increases (i.e., as a ctx_idx_for_affine_flag valueincreases), the probability that a current block will be a block onwhich an affine motion prediction has been performed is high.Accordingly, each context model may be configured as Table 1.

TABLE 1 ctx_idx_for_affine_flag 0 1 2 Init_val N₀ N₁ N₂

In this case, Init_val indicates an initial value, and indicates a givenvalue that satisfies Equation 3.

p(N ₀)<p(N ₁)<p(N ₂)  [Equation 3]

In this case, p(N₀), p(N₁), and p(N₂) mean probability values when theaffine flag (affine_flag) is true in each initial value.

Accordingly, Equation 3 means that the probability that a current blockwill be a block on which an affine motion prediction has been performedis high as the number of neighbor blocks on which an affine motionprediction has been performed is increased.

Referring to FIG. 12, the decoder may derive affine coding informationof a left block and/or top block of a current block (S1210).

The decoder may check whether an affine motion prediction has beenperformed on the left block and/or the top block based on the affinecoding information (S1220).

When an affine motion prediction is performed on the left block,affine_L may be determined as 1 (first value). When an affine motionprediction is performed on the top block, affine_A may be determined as1 (second value) (S1230).

In contrast, when an affine motion prediction is not performed on theleft block, affine_L may be determined as 0 (first value). When anaffine motion prediction is not performed on the top block, affine_A maybe determined as 0 (second value) (S1240).

The decoder may determine the context index of an affine flag based onthe sum of a first value for the left block and a second value for thetop block (S1250).

That is, the decoder may determine the context index of the affine flagbased on the sum of affine coding information of the left block andaffine coding information of the top block. In this case, the affineflag indicates whether an affine motion prediction has been performed.

As described above, the disclosure can determine a context model moresuitable for a current block by determining the context index of asyntax element related to an affine prediction based on affine codinginformation of a neighbor block, and thus can improve performance ofentropy coding/decoding.

FIG. 13 is an embodiment to which the disclosure is applied, and is aflowchart illustrating a process of determining the context index of anaffine parameter flag.

According to an embodiment of the disclosure, when an affineprediction-related syntax element includes an affine parameter flag, thecontext index of the affine parameter flag may be determined based onthe sum of a first value determined by affine coding information andaffine prediction mode information of a left block and a second valuedetermined by affine coding information and affine prediction modeinformation of a top block. In this case, the affine parameter flag is aflag indicating whether an affine motion prediction is performed basedon the AF4 mode or the AF6 mode.

Furthermore, the affine coding information is information indicatingwhether an affine motion prediction has been performed.

The affine prediction mode information is information indicating whetheran affine motion prediction is performed based on the AF4 mode or theAF6 mode. In this case, the AF4 mode indicates that an affine motionprediction is performed by four parameters, and the AF6 mode indicatesthat an affine motion prediction is performed by six parameters.

For another example, the affine prediction mode information may be aflag indicating whether an affine motion prediction is performed basedon the AF6 mode. For example, the affine prediction mode informationindicates that an affine motion prediction is performed by sixparameters when affine_param_flag=1, and indicates that an affine motionprediction is performed by four parameters when affine_param_flag=0.

In the disclosure, a context model for an affine parameter flag(affine_param_flag) is described. The context model of a current block Cuses three context models based on the sum of a first value determinedby affine coding information and affine prediction mode information of aleft block and a second value determined by affine coding informationand affine prediction mode information of a top block, and is describedlike Equation 4.

ctx_idx_for_affine_param_flag=affine_L&&affine_param_L+affine_A&&affine_param_A  [Equation4]

In this case, ctx_idx_for_affine_param_flag is a context index for anaffine parameter flag (affine_param_flag), and may have a value of 0-2.

For example, affine_L indicates whether an affine motion prediction hasbeen performed on a left block. affine_A indicates whether an affinemotion prediction has been performed on a top block. affine_L oraffine_A has a value of 1 when an affine motion prediction is performed,and affine_L or affine_A has a value of 0 when an affine motionprediction is not performed.

For example, affine_param_L indicates whether an affine motionprediction is performed on a left block based on the AF6 mode.affine_param_A indicates whether an affine motion prediction isperformed on a top block based on the AF6 mode. affine_param_L oraffine_param_A has a value of 1 when an affine motion prediction isperformed based on the AF6 mode, and affine_param_L or affine_param_Ahas a value of 0 when an affine motion prediction is not performed basedon the AF6 mode.

Referring to FIG. 13, the decoder may derive affine coding informationand/or affine prediction mode information of a left block and/or topblock of a current block (S1310).

The decoder may check whether an affine motion prediction has beenperformed on the left block and/or the top block based on the affinecoding information (S1320).

The decoder may confirm whether an affine motion prediction has beenperformed based on the AF6 mode or the AF4 mode based on the affineprediction mode information (S1330).

For example, when an affine motion prediction is performed and theaffine motion prediction is performed based on the AF6 mode, (firstvalue) affine_L && affine_param_L=1 may be obtained in the case of aleft block, and (second value)affine_A && affine_param_A=1 may beobtained in the case of a top block (S1340).

In contrast, when an affine motion prediction is not performed or theaffine motion prediction is not performed based on the AF6 mode, (firstvalue) affine_L && affine_param_L=0 may be obtained in the case of aleft block, and (second value)affine_A && affine_param_A=0 may beobtained in the case of a top block (S1350).

The decoder may determine the context index of an affine parameter flagbased on the sum of the first value and the second value. For example,the context index of the affine parameter flag may have a value of 0-2.

As the number of neighbor blocks on which an affine motion predictionhas been performed based on the AF6 mode (i.e., as actx_idx_for_affine_param_flag value increases), the probability that acurrent block will be a block on which an affine motion prediction hasbeen performed based on the AF6 mode is high. Accordingly, each contextmodel may be configured as Table 2.

TABLE 2 ctx_idx_for_affine_param_flag 0 1 2 Init_val N₀ N₁ N₂

In this case, Init_val indicates an initial value, and indicates a givenvalue that satisfies Equation 5.

p(N ₀)<p(N ₁)<p(N ₂)  [Equation 5]

In this case, p(N₀), p(N₁), and p(N₂) mean probability values when anaffine parameter flag (affine_param_flag) is true in each initial value.

Accordingly, Equation 5 means that the probability that a current blockwill be a block on which an affine motion prediction has been performedbased on the AF6 mode is high as the number of neighbor blocks on whichan affine motion prediction has been performed based on the AF6 mode isincreased.

As described above, the disclosure can determine a context model moresuitable for a current block by determining the context index of asyntax element related to an affine prediction based on at least one ofaffine coding information and/or affine prediction mode information of aneighbor block, and thus can improve performance of entropycoding/decoding.

FIG. 14 is an embodiment to which the disclosure is applied, and is aflowchart for describing a method using one context model in order tocode affine_param_flag.

In actual coding/decoding, when the frequency of occurrence ofaffine_param_flag is very low, if three context models are used, anactual occurrence probability and a probability model may be different.For example, the probability that affine_param_flag occurs may becomputed using three context models as in Table 3.

TABLE 3 p(affine_param_flag) QP ctx = 0 1 2 22 37% 59% 49% 27 42% 39%36% 32 41% 42% 46% 37 42% 41% 46%

In this case, it is difficult to find a tendency according to the threecontext models and a tendency according to a QP. Accordingly, thedisclosure may configure one context model like Table 4. An initialvalue may be determined as a value having a given probability based on aQP.

TABLE 4 ctx_idx_for_affine_param_flag 0 Init_val N

Referring to FIG. 14, the encoder/decoder may check whether an affinemotion prediction has been performed on a current block (S1410). Forexample, this may be determined by the process of FIG. 12, and aredundant description is omitted.

If the affine motion prediction has been performed on the current block,the encoder/decoder may parse the affine parameter flag of the currentblock based on a predefined one context model (S1420). In this case, acontext index is always 0 because only one context model is used.

The encoder/decoder may update the context model based on the parsedaffine parameter flag (S1430).

As described above, a syntax element can be coded/decoded moreeffectively compared to a case where a plurality of context models isused because only one context model is used.

In another embodiment to which the disclosure is applied, throughput canbe improved while maintaining coding performance through CABAC bypasscoding of affine_param_flag.

CABAC indicates high coding performance. In contrast, date dependencycauses a throughput bottleneck, in particular, in a high bit rate. CABACmay limit the battery lifespan in video coding/decoding because highthroughput provides a power reduction. This is very important in thecase of a portable device, such as a smartphone. Accordingly, indesigning a video coding system, throughput improvements in addition tocoding efficiency is a very important factor.

Most of throughput improvements may be performed by the bypass (bypasscoding mode) of probability estimation for uniformly distributed bins.

Accordingly, the disclosure provides a method for improving throughputwhile maintaining coding performance through the bypass coding ofaffine_param_flag. Specifically, there is provided a method of using onebin for affine_param_flag and bypass-coding one bin ofaffine_param_flag.

Test results according to the bypass coding of affine_param_flagaccording to the disclosure are shown in Table 5.

TABLE 5 Y U V SDR-UHD −0.02% 0.02% −0.07% SDR-HD 0.02% −0.20% −0.39%Overall 0.00% −0.09% −0.23%

Furthermore, affine_mvp_idx may be decoded separately from mvd_CPi. Thisis described in FIG. 15. In this case, in FIG. 15, mvp_idx may besubstituted with mvd_CPi in FIG. 17 and applied. In this case, mvd_CPiindicates a motion vector difference of a control point CPi.

FIG. 15 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for an affine motion prediction based onan affine flag.

In the disclosure, a context model for coding mvp_idx is described. Asin FIG. 15, a motion vector predictor (MVP) candidate is used in intercoding regardless of whether the MVP candidate has beenaffine-motion-prediction coded. Accordingly, MVP candidates are notseparately used in an affine motion prediction and other interpredictions. Accordingly, the disclosure provides a method using onecontext model for mvp_idx and an initial value.

The decoder may obtain merge_flag and check whether a merge mode isapplied to a current block (S1510).

When the merge mode is not applied to the current block, the decoder mayobtain affine_flag (S1520). In this case, affine_flag indicates whetheran AF mode is performed.

When the affine_flag=1, that is, an AF mode is applied to the currentblock, the decoder may obtain affine_param_flag (S1530). In this case,affine_param_flag indicates whether the AF6 mode is performed (orwhether the AF4 mode is performed).

Furthermore, the decoder may obtain a motion predictor index (mvp_idx)(S1540). In this case, one context model for mvp_idx and an initialvalue may be used.

The decoder may obtain a motion predictor based on the motion predictorindex (mvp_idx), and may reconstruct a video signal based on the motionpredictor.

FIG. 16 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for separately decoding a motionpredictor index for an affine prediction and a motion predictor indexfor an inter prediction.

In the disclosure, a method of designing a CABAC context model bydividing mvp_idx (affine_mvp_idx) for an affine prediction and mvp_idxfor a non-affine prediction is described.

In this case, affine_mvp_idx indicates a candidate to be used for anaffine prediction among two MVP candidates. For example, a first MVPcandidate is used when affine_mvp_idx=0, and a second candidate is usedwhen affine_mvp_idx=1.

mvp_idx indicates a candidate used among two MVP candidates for an interprediction. For example, a first MVP candidate is used when mvp_idx=0,and a second candidate is used when mvp_idx=1.

Probabilities when mvp_idx=0 according to an affine prediction and anon-affine prediction are shown in Table 6.

TABLE 6 QP p(0 | affine) p(0 | non affine) 22 78% 91% 27 76% 89% 32 73%87% 37 71% 85%

From Table 6, the following facts can be known.

1) A probability distribution of mvp indices according to an affineprediction is different.

2) In the case of P(0 | affine), the probability is decreased as a QP isincreased. In this case, P(0 | affine) indicates a probability whenmvp_idx=0 according to an affine prediction.

3) In the case of P(0 | non affine), the probability is increased as theQP is increased. In this case, P(0 | non affine) indicates a probabilitywhen mvp_idx=0 according to a non-affine prediction.

Accordingly, the disclosure proposes separately decoding mvp indicesbased on whether an affine prediction is performed.

The decoder may check whether a merge mode is applied to a current blockby obtaining merge_flag (S1610).

When the merge mode is not applied to the current block, the decoder mayobtain affine_flag (S1620). In this case, affine_flag indicates whetheran AF mode is performed.

When the affine_flag=1, that is, the AF mode is applied to the currentblock, the decoder may obtain affine_param_flag and affine_mvp_idx(S1630, S1640). In this case, affine_param_flag indicates whether theAF6 mode is performed (or whether the AF4 mode is performed).affine_mvp_idx indicate an affine motion vector predictor index.

In contrast, when the affine_flag=0, the decoder may obtain mvp_idx(S1650). In this case, mvp_idx means a motion predictor index for aninter prediction.

The decoder may obtain a motion predictor based on the affine motionvector predictor index or the motion predictor index for an interprediction, and may reconstruct a video signal based on the motionpredictor.

In another embodiment, Table 7 and Table 8 illustrate context models ofaffine_mvp_idx and mvp index and initial values thereof, respectively.

TABLE 7 affine_mvp_idx 0 Init_val N_(affine) _(—) _(mvp) _(—) _(idx)

TABLE 8 mvp_idx 0 Init_val N_(mvp) _(—) _(idx)

As in Table 7, an initial value Naffine_mvp_idx of affine_mvp_idx may bedetermined as a value having a probability that affine_mvp_idx is 0 isdecreased as a QP is increased.

Furthermore, as in Table 8, an initial value Nmvp_idx of mvp_idx may bedetermined as a value having a probability that mvp_idx is 0 isdecreased as a QP is increased.

FIG. 17 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively determining an optimum codingmode based on at least one of an AF4 mode or an AF6 mode.

A video signal processing apparatus may perform a prediction based on atleast one of a skip mode, a merge mode or an inter mode (S1710). In thiscase, the merge mode may include the aforementioned AF merge mode inaddition to a common merge mode. The inter mode may include theaforementioned AF inter mode in addition to a common inter mode.

The video signal processing apparatus may perform a motion vectorprediction based on at least one of the AF4 mode or the AF6 mode(S1720). In this case, step S1710 and step S1720 are not limited totheir sequence thereof.

The video signal processing apparatus may determine an optimum codingmode of the modes by performing a comparison on the results of stepS1720 (S1730). In this case, the results of step S1720 may be comparedbased on a rate-distortion cost.

Thereafter, the video signal processing apparatus may generate themotion vector predictor of a current block based on the optimum codingmode, and may obtain a motion vector difference by subtracting themotion vector predictor from the motion vector of the current block.

Thereafter, the encoding/decoding process described in FIGS. 1 and 2 maybe identically applied.

FIG. 18 is an embodiment to which the disclosure is applied, andillustrates a syntax structure for performing decoding based on the AF4mode or the AF6 mode.

The decoder may check whether a merge mode is applied to a current blockby obtaining merge_flag (S1810).

When the merge mode is not applied to the current block, the decoder mayobtain affine_flag (S1820). In this case, affine_flag indicates whetheran AF mode is performed.

When the affine_flag=1, that is, the AF mode is applied to the currentblock, the decoder may obtain affine_param_flag (S1830). In this case,affine_param_flag indicates whether the AF4 mode is performed (alsoindicates whether an affine motion prediction is performed by fourparameters).

When the affine_param_flag=0, that is, when a motion vector predictionis performed based on the AF4 mode, the decoder may obtain mvd_CP0 andmvd_CP1, that is, a difference between two motion vectors (S1840). Inthis case, mvd_CP0 indicates a motion vector difference for a controlpoint 0, and mvd_CP1 indicates a motion vector difference for a controlpoint 1.

Furthermore, when the affine_param_flag=1, that is, when a motion vectorprediction is performed based on the AF6 mode, the decoder may obtainmvd_CP0, mvd_CP1 and mvd_CP2, that is, three motion vector differences(S1850).

FIG. 19 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively determining an optimum codingmode among motion vector prediction modes, including the AF4 mode or theAF6 mode, based on a condition A.

The encoder may perform a prediction based on at least one of a skipmode, a merge mode or an inter mode (S1910).

The encoder may confirm whether a condition A for a current block issatisfied in order to determine an optimum coding mode for a motionvector prediction (S1920).

In this case, the condition A may mean a condition for a block size. Forexample, the condition A indicates whether the pixel number (pixNum) ofa current block is greater than a threshold TH1. Alternatively, thecondition A indicates whether both the width and height of the currentblock is greater than the threshold TH1. Alternatively, the condition Aindicates whether the width of the current block is greater than thethreshold TH1 or the height of the current block is greater than thethreshold TH1.

When the condition A is satisfied, the encoder may perform a motionvector prediction based on at least one of the AF4 mode or the AF6 mode(S1930).

The encoder may determine an optimum coding mode among motion vectorprediction modes, including the AF4 mode or the AF6 mode, by performinga comparison on the results of step S1910 and S1930 (S1940).

Meanwhile, when the condition A is not satisfied, the encoder maydetermine an optimum coding mode among modes not an AF mode (S1940).

Thereafter, the encoder may generate the motion vector predictor of thecurrent block based on the optimum coding mode, and may obtain a motionvector difference by subtracting the motion vector predictor from themotion vector of the current block.

Thereafter, the encoding/decoding process described in FIGS. 1 and 2 maybe identically applied.

FIG. 20 is an embodiment to which the disclosure is applied, andillustrates a flowchart for adaptively performing decoding based on theAF4 mode or the AF6 mode based on the condition A.

The decoder may receive a bitstream (S2010). The bitstream may includeinformation on a coding mode of a current block within a video signal.

The decoder may confirm whether a condition A for a current block issatisfied in order to determine an optimum coding mode for a motionvector prediction (S2020). In this case, the condition A may mean acondition for a block size. For example, the embodiments of FIG. 18 maybe applied.

When the condition A is satisfied, the decoder may confirm whether acoding mode of the current block is an AF mode (S2030). In this case,the AF mode means an affine motion prediction mode using an affinemotion model, and the embodiments described in the disclosure may beapplied to the AF mode.

In this case, step S2030 may be confirmed by an affine flag indicatingwhether the AF mode is performed. For example, the affine flag may berepresented as affine_flag. The affine flag indicates that the AF modeis applied to the current block when the affine_flag=1, and indicatesthat the AF mode is not applied to the current block when theaffine_flag=0.

When the condition A is not satisfied or the AF mode is not applied tothe current block, the decoder may perform decoding (i.e., motion vectorprediction) based on a coding mode not the AF mode (S2040). For example,a skip mode, a merge mode or an inter mode may be used.

When the AF mode is performed on the current block, the decoder maycheck whether the AF4 mode is applied to the current block (S2050).

In this case, step S1950 may be checked by an affine parameter flagindicating whether the AF4 mode is performed (also indicates whether anaffine motion prediction is performed by four parameters). For example,the affine parameter flag may be represented as affine_param_flag. Theaffine parameter flag may mean that a motion vector prediction isperformed based on the AF4 mode when the affine_param_flag=0 (S2060),and a motion vector prediction is performed based on the AF6 mode whenthe affine_param_flag=1 (S2070), but the disclosure is not limitedthereto.

FIG. 21 illustrates a video coding system to which the disclosure isapplied.

The video coding system may include a source device and a receivingdevice. The source device may transmit, to the receiving device, encodedvideo/image information or data through a digital storage medium or overa network in a file or streaming form.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus and a renderer. The encoding apparatus may be called avideo/image encoding apparatus. The decoding apparatus may be called avideo/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display. The display may beconfigured for each device or external component.

The video source may obtain a video/image through the capture, synthesisor generation process of a video/image. The video source may include avideo/image capture device and/or a video/image generation device. Thevideo/image capture device may include one or more cameras, avideo/image archive including a previously captured video/image, etc.,for example. The video/image generation device may include a computer, atablet and a smartphone, for example, and may (electronically) generatea video/image. For example, a virtual video/image may be generatedthrough a computer. In this case, a process of generating related datamay be substituted with a video/image capture process.

The encoding apparatus may encode an input video/image. The encodingapparatus may perform a series of procedures, such as a prediction, atransform, quantization, and entropy encoding, for compression andcoding efficiency. The encoded data (encoded video/image information)may be output in a bitstream form. In this case, in performing theentropy encoding, the embodiments of the disclosure may be applied.

The transmitter may transmit, to the receiver of the receiving device,encoded video/image information or data output in a bitstream formthrough a digital storage medium or over a network in a file orstreaming form. The digital storage medium may include various storagemedia, such as a USB, an SD, a CD, a DVD, Blu-ray, an HDD, and an SSD.The transmitter may include an element for generating a media filethrough a predefined file format, and may include an element fortransmission over a broadcast/communication network. The receiver mayextract the bitstream and transmit it to the decoding apparatus.

The decoding apparatus may decode a video/image by performing a seriesof procedures, such as entropy decoding, de-quantization, an inversetransform, and a prediction corresponding to operations of the encodingapparatus. In this case, in performing the entropy decoding, theembodiments of the disclosure may be applied.

The renderer may render a decoded video/image. The rendered video/imagemay be displayed through a display.

FIG. 22 illustrates a content streaming system to which the disclosureis applied.

Referring to FIG. 22, the content streaming system to which thedisclosure is applied may basically include an encoding server, astreaming server, a web server, a media storage, a user equipment and amultimedia input device.

The encoding server basically functions to generate a bitstream bycompressing content input from multimedia input devices, such as asmartphone, a camera or a camcorder, into digital data, and to transmitthe bitstream to the streaming server. For another example, ifmultimedia input devices, such as a smartphone, a camera or a camcorder,directly generate a bitstream, the encoding server may be omitted.

The bitstream may be generated by an encoding method or bitstreamgeneration method to which the disclosure is applied. The streamingserver may temporally store a bitstream in a process of transmitting orreceiving the bitstream.

The streaming server transmits multimedia data to the user equipmentbased on a user request through the web server. The web server plays arole as a medium to notify a user that which service is provided. When auser requests a desired service from the web server, the web servertransmits the request to the streaming server. The streaming servertransmits multimedia data to the user. In this case, the contentstreaming system may include a separate control server. In this case,the control server functions to control an instruction/response betweenthe apparatuses within the content streaming system.

The streaming server may receive content from the media storage and/orthe encoding server. For example, if content is received from theencoding server, the streaming server may receive the content in realtime. In this case, in order to provide smooth streaming service, thestreaming server may store a bitstream for a given time.

Examples of the user equipment may include a mobile phone, a smartphone, a laptop computer, a terminal for digital broadcasting, personaldigital assistants (PDA), a portable multimedia player (PMP), anavigator, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch type terminal (smartwatch), a glass type terminal (smartglass), and a head mounted display (HMD)), digital TV, a desktopcomputer, and a digital signage.

The servers within the content streaming system may operate asdistributed servers. In this case, data received from the servers may bedistributed and processed.

As described above, the embodiments described in the disclosure may beimplemented in a computer, processor, micro-processor, controller orchip and performed. For example, the function units shown in drawings ofthe present application may be implemented in a computer, processor,micro-processor, controller or chip and performed.

As described above, the decoder and the encoder to which the disclosureis applied may be included in a multimedia broadcastingtransmission/reception apparatus, a mobile communication terminal, ahome cinema video apparatus, a digital cinema video apparatus, asurveillance camera, a video chatting apparatus, a real-timecommunication apparatus, such as video communication, a mobile streamingapparatus, a storage medium, a camcorder, a VoD service providingapparatus, an Internet streaming service providing apparatus, athree-dimensional 3D video apparatus, a teleconference video apparatus,and a medical video apparatus and may be used to code video signals anddata signals.

Furthermore, the decoding/encoding method to which the disclosure isapplied may be produced in the form of a program that is to be executedby a computer and may be stored in a computer-readable recording medium.Multimedia data having a data structure according to the disclosure mayalso be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesin which data readable by a computer system is stored. Thecomputer-readable recording media may include a BD, a USB, ROM, RAM,CD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice, for example. Furthermore, the computer-readable recording mediaincludes media implemented in the form of carrier waves, e.g.,transmission through the Internet. Furthermore, a bit stream generatedby the encoding method may be stored in a computer-readable recordingmedium or may be transmitted over wired/wireless communication networks.

INDUSTRIAL APPLICABILITY

The exemplary embodiments of the disclosure have been disclosed forillustrative purposes, and those skilled in the art may improve, change,replace, or add various other embodiments within the technical spiritand scope of the disclosure disclosed in the attached claims.

1. A method of performing entropy decoding on a video signal including acurrent block, the method comprising: checking whether a left block andtop block neighboring the current block are available; deriving affinecoding information and/or affine prediction mode information of the leftblock and/or the top block when at least one of the left block and/orthe top block is available; determining a context index of an affineprediction-related syntax element of the current block based on at leastone of the affine coding information and/or affine prediction modeinformation of the left block and/or the top block; and entropy-decodingan affine prediction-related syntax element of the current block basedon the context index, wherein the affine coding information isinformation indicating whether an affine motion prediction has beenperformed, wherein the affine prediction mode information is informationindicating whether the affine motion prediction is performed based on anAF4 mode or an AF6 mode, wherein the AF4 mode indicates that an affinemotion prediction is performed by four parameters, and wherein the AF6mode indicates that an affine motion prediction is performed by sixparameters.
 2. The method of claim 1, wherein when the affineprediction-related syntax element includes an affine flag, a contextindex of the affine flag is determined based on a sum of the affinecoding information of the left block and the affine coding informationof the top block, and wherein the affine flag is a flag indicatingwhether an affine motion prediction has been performed.
 3. The method ofclaim 1, wherein when the affine prediction-related syntax elementincludes an affine parameter flag, a context index of the affineparameter flag is determined based on a sum of a first value determinedby the affine coding information and affine prediction mode informationof the left block and a second value determined by the affine codinginformation and affine prediction mode information of the top block, andwherein the affine parameter flag is a flag indicating whether an affinemotion prediction is performed based on the AF4 mode or the AF6 mode. 4.The method of claim 3, wherein an affine motion prediction is performedon the left block based on the affine flag, and wherein the first valueis determined as 1 when the left block is coded based on the AF6 modebased on the affine parameter flag, and the first value is determined as0 when the left block is not coded based on the AF6 mode based on theaffine parameter flag.
 5. The method of claim 3, wherein an affinemotion prediction is performed on the top block based on the affineflag, and wherein the second value is determined as 1 when the top blockis coded based on the AF6 mode based on the affine parameter flag, andthe second value is determined as 0 when the top block is not codedbased on the AF6 mode based on the affine parameter flag.
 6. The methodof claim 1, wherein when the affine prediction-related syntax elementincludes an affine motion vector predictor index and/or a non-affinemotion vector predictor index, the affine motion vector predictor indexand the non-affine motion vector predictor index are defined bydifferent tables, wherein the affine motion vector predictor indexindicates a candidate used for an affine motion prediction, and whereinthe non-affine motion vector predictor index indicates a candidate usedfor an inter prediction.
 7. An apparatus performing entropy decoding ona video signal including a current block, the apparatus comprising: acontext modeling unit configured to check whether a left block and topblock neighboring the current block are available, derive affine codinginformation and/or affine prediction mode information of the left blockand/or the top block when at least one of the left block and/or the topblock is available, and determine a context index of an affineprediction-related syntax element of the current block based on at leastone of the affine coding information and/or affine prediction modeinformation of the left block and/or the top block; and a binaryarithmetic decoding unit configured to entropy-decode an affineprediction-related syntax element of the current block based on thecontext index, wherein the affine coding information is informationindicating whether an affine motion prediction has been performed,wherein the affine prediction mode information is information indicatingwhether the affine motion prediction is performed based on an AF4 modeor an AF6 mode, wherein the AF4 mode indicates that an affine motionprediction is performed by four parameters, and wherein the AF6 modeindicates that an affine motion prediction is performed by sixparameters.
 8. The apparatus of claim 7, wherein when the affineprediction-related syntax element includes an affine flag, a contextindex of the affine flag is determined based on a sum of the affinecoding information of the left block and the affine coding informationof the top block, and wherein the affine flag is a flag indicatingwhether an affine motion prediction has been performed.
 9. The apparatusof claim 7, wherein when the affine prediction-related syntax elementincludes an affine parameter flag, a context index of the affineparameter flag is determined based on a sum of a first value determinedby the affine coding information and affine prediction mode informationof the left block and a second value determined by the affine codinginformation and affine prediction mode information of the top block, andwherein the affine parameter flag is a flag indicating whether an affinemotion prediction is performed based on the AF4 mode or the AF6 mode.10. The apparatus of claim 9, wherein an affine motion prediction isperformed on the left block based on the affine flag, and wherein thefirst value is determined as 1 when the left block is coded based on theAF6 mode based on the affine parameter flag, and the first value isdetermined as 0 when the left block is not coded based on the AF6 modebased on the affine parameter flag.
 11. The apparatus of claim 9,wherein an affine motion prediction is performed on the top block basedon the affine flag, and wherein the second value is determined as 1 whenthe top block is coded based on the AF6 mode based on the affineparameter flag, and the second value is determined as 0 when the topblock is not coded based on the AF6 mode based on the affine parameterflag.
 12. The apparatus of claim 7, wherein when the affineprediction-related syntax element includes an affine motion vectorpredictor index and/or a non-affine motion vector predictor index, theaffine motion vector predictor index and the non-affine motion vectorpredictor index are defined by different tables, wherein the affinemotion vector predictor index indicates a candidate used for an affinemotion prediction, and wherein the non-affine motion vector predictorindex indicates a candidate used for an inter prediction.